#include "Wall.h"
#include "Pen.h"
//EAST/WEST BOUNDING BOX
RECT EWBox = {5,20,-5,-20};
//NORTH/SOUTH BOUNDING BOX
RECT NSBox = {20,5,-20,-5};

Wall::Wall() : BaseObject()
{
	m_Type = WALL_TYPE;
	m_Mesh = Pen::Engine()->getMeshByIndex(WALL_MESH);
	m_pTexture = Pen::Engine()->getTextureByIndex(GREEN_TEXTURE);
	m_BoundingBox.top		= 0;
	m_BoundingBox.left		= 0;
	m_BoundingBox.bottom	= 0;
	m_BoundingBox.right		= 0;
}
Wall::Wall(D3DXVECTOR3 P) : BaseObject()
{
	m_Type = WALL_TYPE;
	m_vPosition = P;
	m_Mesh = Pen::Engine()->getMeshByIndex(WALL_MESH);
	m_pTexture = Pen::Engine()->getTextureByIndex(GREEN_TEXTURE);
	m_BoundingBox.top		= 0;
	m_BoundingBox.left		= 0;
	m_BoundingBox.bottom	= 0;
	m_BoundingBox.right		= 0;
}
void Wall::Reset()
{
	m_stRotation.clear();
}
void Wall::SetBoundingBox(int Dir)
{
	if(Dir == EAST || Dir == WEST)
	{
		m_BoundingBox.top		= (LONG)(m_vPosition.y + EWBox.top);
		m_BoundingBox.left		= (LONG)(m_vPosition.x + EWBox.left);
		m_BoundingBox.bottom	= (LONG)(m_vPosition.y + EWBox.bottom);
		m_BoundingBox.right		= (LONG)(m_vPosition.x + EWBox.right);
	}
	if(Dir == NORTH || Dir == SOUTH)
	{
		m_BoundingBox.top		= (LONG)(m_vPosition.y + NSBox.top);
		m_BoundingBox.left		= (LONG)(m_vPosition.x + NSBox.left);
		m_BoundingBox.bottom	= (LONG)(m_vPosition.y + NSBox.bottom);
		m_BoundingBox.right		= (LONG)(m_vPosition.x + NSBox.right);
	}
}
void Wall::MakeFiller()
{
	m_Type = FILLER_TYPE;
	m_BoundingBox.top =
	m_BoundingBox.bottom = 
	m_BoundingBox.left =
	m_BoundingBox.right = 0;
	m_Mesh = Pen::Engine()->getMeshByIndex(FILLER_MESH);
	m_pTexture = Pen::Engine()->getTextureByIndex(GREEN_TEXTURE);
}
